Load and DisplayΒΆ
Images can be loaded and displayed to the screen at their actual size or any other size.
from p5 import *
img = None
def setup():
global img
size(720, 400)
img = load_image("moonwalk.jpg")
def draw():
global img
background(0)
image(img, 0, 0)
image(img, 0, height / 2, img.width / 2, img.height / 2)
if __name__ == '__main__':
run()